home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / arexx / ole1v10a.lha / OLE_System / modules / fw3 / DrawRefoldMarks.fw < prev    next >
Encoding:
Text File  |  1995-02-10  |  1.6 KB  |  107 lines

  1. /*
  2.  * DrawRefoldMarks.fw
  3.  *
  4.  * USAGE: DrawRefoldMarks.fw
  5.  *
  6.  * DrawRefoldMarks.fw draw the refold marks in a document of Final Writer.
  7.  *
  8.  * HISTORY:
  9.  * v1.01    now this is an OLE module
  10.  *
  11.  * v1.02    refold marks refer to the section setup
  12.  *
  13.  * v1.03    all marks are grouped
  14.  *
  15.  * v1.04    aligned with the new server design v1.10
  16.  *
  17.  * $(C): (1994, Rocco Coluccelli, Bologna)
  18.  * $VER: DrawRefoldMarks.fw 1.04 (30.Nov.1994)
  19.  */
  20.  
  21. OPTIONS RESULTS
  22.  
  23. PARSE ARG oleclip
  24. PARSE VALUE GETCLIP(oleclip) WITH jobID modID . . . . . oleport . . userport olepipe .
  25.  
  26. /*
  27.  *    olepipe = doallpages fold1 fold2 ...
  28.  */
  29. fold. = 0
  30. result = GETCLIP(olepipe)
  31. refolds = WORDS(result) - 1
  32. DO i = 1 TO refolds
  33.     fold.i = WORD(result,i + 1)
  34. END
  35.  
  36.  
  37. ADDRESS VALUE userport
  38.  
  39. SetMeasure "MICROPOINTS"
  40. View 50
  41.  
  42. /*
  43.  *    Marks position and dimension
  44.  */
  45. GetSectionSetup 'Inside'
  46. x1 = 2 * result % 10
  47. x2 = x1 + MIN(5 * result % 10,144)
  48.  
  49. GetPageSetup 'Height'
  50. y0 = result % 100
  51.  
  52. /*
  53.  *    store current values for lines
  54.  */
  55. GetLinePrefs 'LineWt' 'LineColor'
  56. PARSE VAR result linewt linecolor
  57.  
  58. LinePrefs 'LineWt' 'HairLine' 'LineColor' 'Black'
  59.  
  60. IF WORD(olepipe,1) = 1 THEN DO
  61.  
  62.     EditRightMaster
  63.     CALL DrawMarks(1)
  64.  
  65.     GetPageSetup 'Pages'
  66.     IF UPPER(result) = 'LEFTRIGHT' THEN DO
  67.         EditLeftMaster
  68.         CALL DrawMarks(1)
  69.         END
  70.  
  71.     EditBody
  72.     END
  73.  
  74. ELSE DO
  75.  
  76.     Status 'Page'
  77.     CALL DrawMarks(result)
  78.     END
  79.  
  80.  
  81. Redraw
  82.  
  83. /*
  84.  *    restore last values for lines
  85.  */
  86. LinePrefs 'LineWt' linewt 'LineColor' linecolor
  87.  
  88. ADDRESS VALUE oleport
  89. SETJOB jobID 'end'
  90.  
  91. EXIT 0
  92.  
  93.  
  94. DrawMarks:
  95.  
  96.     DO i = 1 TO refolds
  97.         DrawLine ARG(1) x1 (y0 * fold.i) x2 (y0 * fold.i)
  98.         line.i = result
  99.     END
  100.  
  101.     DO i = 1 TO refolds
  102.         SelectObject line.i 'MULTIPLE'
  103.     END
  104.     Redraw
  105.  
  106. RETURN
  107.